﻿using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MongoDB.Model
{
    public class Mongo_TaskManageModel
    {
        /// <summary>
        /// Id
        /// </summary>
        [BsonId]
        public ObjectId ID { get; set; }

        /// <summary>
        /// 唯一主键
        /// </summary>
        public string guid { get; set; }

        /// <summary>
        /// 任务名称
        /// </summary>
        public string TaskName { get; set; }

        /// <summary>
        /// 任务组名称
        /// </summary>
        public string GroupName { get; set; }

        /// <summary>
        /// 任务所需要调用的Url
        /// </summary>
        public string TaskUrl { get; set; }

        /// <summary>
        /// 请求方式
        /// </summary>
        public string Method { get; set; }

        /// <summary>
        /// 请求内容
        /// </summary>
        public string RequestBody { get; set; }

        /// <summary>
        /// 1:FromBody(json),2.FromForm
        /// </summary>
        public int BodyType { get; set; }

        /// <summary>
        /// 任务执行时间配置
        /// </summary>
        public string TaskCron { get; set; }

        /// <summary>
        /// 验证方式，0:为不验证。如果验证为Task_Auth的Guid
        /// </summary>
        public string AuthType { get; set; }

        /// <summary>
        /// 验证方式名称，用于展示
        /// </summary>
        public string AuthName { get; set; }

        /// <summary>
        /// 请求头
        /// </summary>
        public string Token { get; set; }

        /// <summary>
        /// 是否开启
        /// </summary>
        public int IsOpen { get; set; }

        /// <summary>
        /// 发生错误时是否需要邮件提醒
        /// </summary>
        public int IsTip { get; set; }

        /// <summary>
        /// 当发生多少次后进行邮件提醒
        /// </summary>
        public int? ErrorNumTip { get; set; }

        /// <summary>
        /// 最多提醒次数
        /// </summary>
        public int? MaxTipNum { get; set; }

        /// <summary>
        /// 任务创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }
    }
}
